home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / boost4.zip / VERIFY.PAS < prev    next >
Pascal/Delphi Source File  |  1988-10-23  |  1KB  |  54 lines

  1. Program VerifyMain;
  2.  
  3. { Demos Boosters' Verify function }
  4.  
  5. uses BOSHARE,crt;
  6. var
  7.    s,ref        : String;
  8.    i,j,
  9.    VerifyResult : integer;
  10.    c            : char;
  11.  
  12. Const
  13.    Esc = #27;
  14.  
  15.  
  16. BEGIN
  17.  
  18.    {--- Define reference set }
  19.    ref := 'ABCD,FGHIJKLMNOPQRSTUVWXYZ';
  20.  
  21.    repeat  { until ESCAPE pressed }
  22.       ClrScr;
  23.       PutStr(h,Center('Type a phrase, then press ENTER',80,' '),1,1,14);
  24.       PutStr(h,Center('All characters NOT in reference set will be flagged',
  25.                        80,' '),1,2,14);
  26.       PutStr(h,center('Reference Set',80,' '),1,4,14);
  27.       PutStr(h,center(ref,80,' '), 1, 5, 14 );
  28.  
  29.       {--- Get phrase from user }
  30.       input ( 1, 6, Copies('C',80), s, c, 30 );
  31.  
  32.       {--- Flag each character not in ref }
  33.       if c <> Esc then
  34.       begin
  35.          s := strip(s,' ');
  36.          i := 1;
  37.          VerifyResult := verify(s,ref,i);
  38.          while VerifyResult <> 0 do
  39.          begin
  40.             PutStr(h,'^',VerifyResult, 7, 14 );
  41.             i := VerifyResult + 1;
  42.             VerifyResult := verify(s,ref,i);
  43.          end;
  44.  
  45.          { Wait for keypress }
  46.          PutStr(h,'ESCAPE quits, any other key continues.',1,9,14);
  47.          c := readkey;
  48.          if c =#0 then c := readkey;
  49.       end;
  50.    until c = Esc;
  51.  
  52. END.
  53.  
  54.